package o;

import android.annotation.TargetApi;
import android.content.Context;
import android.os.Environment;
import java.io.File;

public abstract class doc {
    public static boolean ˋ() {
        try {
            if ("mounted".equals(Environment.getExternalStorageState()) || !ˎ()) {
                return true;
            }
            return false;
        } catch (ArrayIndexOutOfBoundsException e) {
            Logger.e("StorageUtils", e.toString());
            return false;
        }
    }

    @TargetApi(9)
    protected static boolean ˎ() {
        if (doe.ॱ()) {
            return Environment.isExternalStorageRemovable();
        }
        return true;
    }

    public static String ॱ(Context context) {
        if (ˋ()) {
            File externalFilesDir = context.getExternalFilesDir(null);
            if (externalFilesDir != null) {
                return externalFilesDir.getAbsolutePath();
            }
        }
        return context.getFilesDir().getAbsolutePath();
    }
}
